﻿using System.Configuration;
using System;
using UtfprLibrary.Exceptions;

namespace UtfprLibrary.Configurations {
    /// <summary>
    /// TODO
    /// </summary>
    internal class UtfprSection : UtfprSectionBase {
        /// <summary>
        /// TODO
        /// </summary>
        /// <exception cref="UtfprLibrary.Exceptions.UtfprConfigurationsException">Thrown when an exception occurs.</exception>
        [ConfigurationProperty("security", IsRequired = true)]
        public SecurityElement Security {
            get {
                try {
                    return (SecurityElement)this["security"];
                } catch (Exception ex) {
                    throw new UtfprConfigurationsException("Could not get 'security' value.", ex);
                }
            }
            set {
                try {
                    this["security"] = value;
                } catch (Exception ex) {
                    throw new UtfprConfigurationsException("Could not set 'security' value.", ex);
                }
            }
        }   
    }
}
